<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>驴友社交——找回密码</title>
    <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="js/Check.js" type="text/javascript"></script>

    <script src="js/GA_Statistics.js" type="text/javascript"></script>

    <link href="CSS/forget.css" rel="stylesheet" type="text/css" />

    <link href="CSS/footer.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">

        $(function () {

            $("#forgetPass").removeClass().addClass("z_li_j_d");

            stateUserName = true;

            stateUserPhone = true;

            var errorMsg = $("#hiddenErrorMsg").val();

            if (errorMsg != "undefined" && errorMsg != null && errorMsg != "") {

                if (errorMsg == "NoPass") {

                    alert("手机号或者用户名错误，请重新输入!");

                }

                else {

                    alert("新密码已经通过短信下发到您的手机，请注意查收谢谢!");

                    window.location.href = "Index.html";

                }

            }

        });

        var stateSubUserName = false;

        var validate =

        {

            UserNameOnfocus: function () {

                $("#UserNameMsg").html("");

                $("#UserNameOK").removeClass().addClass("z_right_li_c").css({ display: "none" });

                $("#UserNameError").hide();

            },

            UserNameOnblur: function () {

                $("#UserNameMsg").html("");

                $("#UserNameShow").hide();

                var userName = $("#UserNameInput").val();

                var regEmail = /^([0-9a-z][0-9a-z_]*[0-9a-z]|[0-9a-z])@[a-z0-9.-]+\.[a-z]{2,4}$/i;

                if (userName == "") {

                    $("#UserNameError").show();

                    $("#UserNameMsg").html("请输入您的登录账号!");

                }

                else if (!regEmail.test(userName) && userName.indexOf("@") != -1) {

                    $("#UserNameError").show();

                    $("#UserNameMsg").html("请输入正确的登录账号！");

                }

                else if (userName.length > 30) {

                    $("#UserNameError").show();

                    $("#UserNameMsg").html("请输入正确的登录账号!")

                }

                else {

                    $("#UserNameOK").show();

                    stateSubUserName = true;

                }

            }

        };

        function Submit() {

            if (!stateSubUserName || !subUserPhone || !subUserCode) {

                validate.UserNameOnblur();

                Checked.UserPhoneOnblur();

                Checked.UserCodeOnblur();

                return;

            }

            document.forms[0].submit();

        }

    </script>

<link href="CSS/reg.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="content">
   <div class="z_main">
       <div class="z_left">
            <div class="z_logo">
                   <a href="javascript:void(0)"><img src="images/z_logo.png" border="0" /></a></div>
           <div class="z_li">
              <a href="Index.html" id="index" class="z_li_a"></a>
              <a href="Register.html" id="register" class="z_li_b"></a>
              <a href="Login.html" id="login" class="z_li_c1"></a>
              <a href="ForgetPassword.html" id="forgetpass" class="z_li_d1"></a>
           </div>
       </div>
       <div class="z_right">
            <div class="z_right_li">

                    <div class="z_right_li_a">

                        电子邮箱:</div>

                    <input type="text" name="UserNameInput" id="UserNameInput" value=""

                        class="z_right_li_b" onfocus="validate.UserNameOnfocus();" onblur="validate.UserNameOnblur();" />

                    <div id="UserNameShow" class="z_tishi" style="display: none">

                    </div>

                    <div id="UserNameOK" class="z_right_li_c" style="display: none">

                    </div>

                    <div id="UserNameError" style="position: relative; display: none;">

                        <div class="z_right_wrong">

                        </div>

                        <div id="UserNameMsg" class="z_wrong">

                        </div>

                    </div>

                </div>

                <div class="z_right_li" style="height: 25px;">

                </div>

                <div class="z_right_li">

                    <div class="z_right_li_a">

                        新密码:</div>

                    <input name="Password" type="password" id="Password" class="z_right_li_b" onfocus="Checked.UserPassOnfocus();"

                        onblur="Checked.UserPassOnblur();" />

                    <div id="PhoneMsgShow" class="z_tishi" style="display: none">

                        填写您的新密码</div>

                    <div id="PhoneOK" class="z_right_li_c" style="display: none;">

                    </div>

                    <div id="PhoneMsgError" style="position: relative; display: none;">

                        <div class="z_right_wrong">

                        </div>

                        <div id="PhoneMsg" class="z_wrong">

                        </div>

                    </div>

                </div>

                <div class="z_right_li" style="height: 25px;">

                </div>

                <div class="z_right_li">

                    <div class="z_right_li_a">

                        验证码:</div>

                    <input type="text" id="AuthCodeInput" name="AuthCodeInput" class="z_yanzheng" value=""

                        maxlength="4" onfocus="Checked.UserCodeOnfocus();" onblur="Checked.UserCodeOnblur();" />

                    <div style="float: left;">

                        <img src="/CheckCode/Index" id="AuthCodeImage" width="62" height="28" hspace="0"

                            vspace="0" border="0" id="ctl00_Body_AuthCodeImage" />

                        <a href="javascript:document.getElementById('AuthCodeImage').src='/CheckCode/Index?d='+new Date().getTime();void(0);"

                            style="font-size: 12px; margin-left: 0px;">换一张</a></div>

                    <div style="float: left; width: 50%;">

                        <div id="CodeOk" class="z_right_li_c" style="display: none;">

                        </div>

                        <div id="CodeError" style="position: relative; display: none;">

                            <div class="z_right_wrong">

                            </div>

                            <div id="CodeMsg" class="z_wrong">

                            </div>

                        </div>

                    </div>

                </div>

                <div class="z_right_li" style="height: 24px;">

                </div>

                <div class="z_right_li">

                    <div class="t_icton_a">

                        <a href="javascript:Submit();" style="cursor: url()">找&nbsp;回&nbsp;密&nbsp;码</a></div>

                </div>

       </div>
   </div>
</div>
<div class="footer">

    <center class="footerNav">

        <a href="/About.html" target="_blank">关于我们</a>| <a href="/FLink.html" target="_blank">

            友情链接</a>| <a href="/ContactUs.html" target="_blank">联系我们</a>| <a href="/Help.html"

                target="_blank">帮助中心</a>| <a href="/UserMessage.html" target="_blank">用户留言</a>

    </center>

    <center>

        版权所有北京交通大学软件学院 fine girls项目小组</center>

    <center>

        Copyright&copy; 2008-2012 Reunion Infotech co. ltd All rights reserved.</center>

</div>
</body>
</html>
